﻿/*****************************************介绍*****************************************
 * 作者：Ywh
 * 创建时间：2024-06-08 10:52:37
 * 功能：初始化结果
**************************************************************************************/

namespace Game.Framework
{
    internal struct InitResult
    {
        internal string error;
        internal E_ResultType type;
        internal float progress;

        internal InitResult(E_ResultType type)
        {
            error = "";
            this.type = type;
            progress = 0;
        }

        internal InitResult(string error, E_ResultType type)
        {
            this.error = error;
            this.type = type;
            progress = 0;
        }

        public static InitResult Wait => new InitResult(E_ResultType.Waiting);

        public static InitResult Success => new InitResult(E_ResultType.Success);

        public override string ToString()
        {
            string error = string.IsNullOrEmpty(this.error) ? "Null" : this.error;
            return $"type:{type} error:{error}";
        }
    }
}